<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>邀请好友</title>
	<meta name="author" content="CSC">
	<meta name="description" content="普济一城">
	<meta name="viewport" content="initial-scale=1,maximum-scale=1">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="transparent">
	<meta name="format-detection" content="telephone=no,email=no">
	<link rel="stylesheet" type="text/css" href="../../css/base.css">
	<link rel="stylesheet" type="text/css" href="../../css/sylunbo/yaoqinghaoyou.css">
	<link rel="stylesheet" type="text/css" href="../../css/layer.css">
</head>
<body>
	<div id="yqhy">
		<div id="btn">
			
		</div>
	</div>
	
	<!--返回-->
	<div class="headaL">
		<img src="../../img/d_fanhui.png">
	</div>
</body>
<script type="text/javascript" src="../../js/zepto.min.js"></script>
<script type="text/javascript" src="../../js/common.js"></script>
<script type="text/javascript" src="../../js/layer.js"></script>
<script type="text/javascript">
	var uuid;
	var phone;
	var token;
	$('#btn').on('click',function(){
    	if(Auth()){
    			uuid=user_info.uuid,
    			phone=user_info.phone,
    			memberId=user_info.id,
    			token = user_info.token
    	} else{
    		sessionStorage.setItem('history', window.location.href);
    		toClientLogin(location.href)
    	}

    		var $self = $(this)
    		if($self.hasClass("disabled")){
    			return false
    		}
    		$self.addClass("disabled")
    		setTimeout(function(){
    			$self.removeClass("disabled")
    		},1000)

	  var data = {
	    type: 1,
	    url:rootdomain+"/html/sylunbo/share.html?phone="+phone+"&token="+token+"&from=singlemessage",
	    // url:rootdomain+"/html/sylunbo/share.html",
	    title: '点击查看好友邀请',
	    content:'您有一个50元的新人红包待领取' ,
	    //			hunterId:hunterId
	  }
	  console.log(data)
	  var share = data;
	  console.log(share)
	  zhuanfa(share);
	})
	//分享
function zhuanfa(data) {
  if (/pjyc_i/.test(ua)) {

    setupWebViewJavascriptBridge(function(bridge) {
      bridge.callHandler('jsToClientShare', data, function(resp) {});
    });
  } else if (/pujiyicheng/.test(ua)) {
    //var result = lase;
    var data2 = JSON.stringify(data);

    window.stub.jsToClientShare(data2); //用接口stub, 通过调用内部类中的方法jsMethod给java传回result。

  }
}


	//返回
	var ua = navigator.userAgent.toLowerCase();

	$(".headaL").click(function(){
		if(sessionStorage.getItem('fromHTML') == 'H5'){
				sessionStorage.removeItem('fromHTML');
				window.history.go(-1);
		} else if (/pjyc_i/.test(ua)) {
	    		setupWebViewJavascriptBridge(function(bridge){
	            bridge.callHandler("goBack",function(data,responseCallback){
	    });
	            });
	    } else if (/pujiyicheng/.test(ua)) {
	            window.stub.goBack();
	    }
	});	
</script>
</html>

